<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>评论</title>
<script type="text/javascript" src="../js/jquery-1.11.0.js"></script>
<script type="text/javascript" src="../js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="../js/bootstrap.js"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<link rel="stylesheet" href="../css/bootstrap-theme.min.css" />
<link rel="stylesheet" href="../css/bootstrap.css" />
<link rel="stylesheet" href="../css/bootstrap.min.css" />
<link rel="stylesheet" href="../css/bootstrap-theme.css" />
<link rel="stylesheet" type="text/css" href="../css/front/comment.css" />
<style type="text/css">

.rz-pl{
	width: 70%;
}
.table {
	text-align: center;
}

.fy {
	float: right;
	margin: 0px auto;
}

.sp-a {
	font-size: 16px;
}

.body_right_head {
	border-bottom: 1px solid;
	border-color: #F0F0F0;
	padding-bottom: 5px;
}
</style>
<script type="text/javascript">
$(function(){
	$(".delete").click(function(){
		var id = $(this).parents("tr").find("td").eq(0).text();
		var index = $(this).parents("tr").index();
		alert(id);
		$.ajax({
			type:"get",
			url:"del-com",
			data:"id="+id,
			success:function(e){
				if(e > 0) {
					$(".table").find("tr").eq(index).remove();
					alert("删除成功！");
				}
				
			}
		})
	})
	
})

</script>
</head>
<body>
	<div class="rz-pl">

		<!-- Nav tabs -->
		<ul class="nav nav-tabs" role="tablist">
			<li role="presentation" class="active"><a href="#home"
				aria-controls="home" role="tab" data-toggle="tab">日志评论</a></li>
		</ul>

		<!-- Tab panes -->
		<table class="table table-striped table-hover table-bordered">
			<tr class="info">
				<td>文章ID</td>
				<td>评论者</td>
				<td>评论内容</td>
				<td>评论时间</td>
				<td>操作</td>
			</tr>
			<c:forEach items="${colst}" var="cl">
				<tr>
					<td>${cl.getArtId()}</td>
					<td>${cl.getComPeopleName()}</td>
					<td>${cl.getComContext()}</td>
					<td>${cl.getComTime()}</td>
					<td><a class="btn btn-default del-a btn btn-danger delete"
						role="button" >删除</a></td>
				</tr>
			</c:forEach>
		</table>
		<ul class="pagination fy">
			<li><a href="#">&laquo;</a></li>
			<li><a href="#">1</a></li>
			<li><a href="#">2</a></li>
			<li><a href="#">3</a></li>
			<li><a href="#">&raquo;</a></li>
		</ul>
	</div>
</body>
</html>